/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { useMemo } from 'react';
import ProTable from '@ant-design/pro-table';
import DragTable from '@/components/DragTable';
import { Card } from 'antd';
import { isEmpty } from 'lodash';

const AppLoginList: React.FC<any> = (props) => {
  const { data = {}, columns = [] } = props;

  const dataSource = useMemo(() => {
    return !isEmpty(data) ? [data] : [];
  }, [data]);

  return (
    <Card
      title='详情'
      style={{
        borderBottom: '24px solid #eef0f3',
      }}
    >
      <DragTable>
        <ProTable
          rowKey='id'
          toolBarRender={false}
          pagination={false}
          dataSource={dataSource}
          columns={columns}
          search={false}
          scroll={{ x: 1200 }}
        />
      </DragTable>
    </Card>
  );
};

export default AppLoginList;
